/******************************************************************************
**                                                                           **
**                 Proprietary and Confidential Information                  **
**                                                                           **
**                 Copyright (c) Conexant, Inc. Unpublished                  **
**                                                                           **
** This source code and the algorithms implemented therein constitute        **
** confidential information and may compromise trade secrets of Conexant Systems,    **
** Inc. or its associates, and any unauthorized use thereof is prohibited.   **
**                                                                           **
******************************************************************************/
#ifndef __DC_PRINTER_CUSTOM_API_H__
#define __DC_PRINTER_CUSTOM_API_H__

#ifdef __cplusplus
extern "C" {
#endif

/**************************************************************************//**
*  @file dc_printer_custom_api.h
*  @brief This file contains the custom definitions used by the Conexant 
*  Printer API.
******************************************************************************/
/******************************************************************************
*  FILE FORMAT: <PUBLIC>
*      1. INCLUDES 
*      2. ENUMERATIONS 
*      3. DEFINES
*      4. STRUCTURES
*      5. GLOBALS
*      6. PUBLIC FUNCTION PROTOTYPES
******************************************************************************/

/******************************************************************************
*  1. INCLUDES
******************************************************************************/


/******************************************************************************
*  2. ENUMERATIONS
******************************************************************************/
typedef enum
{
    PR_UTILITY_MEDIA_DETECT,
    PR_UTILITY_FORM_FEED,
    PR_UTILITY_INSTALL_START,
    PR_UTILITY_INSTALL_END,
    PR_UTILITY_MAINT_JOB
} PRC_UTILITY_TYPE;

typedef enum 
{
    PR_QUALITY_DRAFT,
    PR_QUALITY_NORMAL,
    PR_QUALITY_BETTER,
    PR_QUALITY_BEST
} PRC_QUALITY;


/******************************************************************************
*  3. DEFINES
******************************************************************************/


/******************************************************************************
*  4. STRUCTURES
******************************************************************************/

typedef struct
{
    // Incremented when each page has started printing
    UINT32 page_within_job;

    // Error code containing the active error detected by the printer
    UINT32 current_error;

    // Error code containing the active warning detected by the printer
    UINT32 current_warning;

    // Name of the current media type installed in the printer
    char media_type[64];

    // This flag is TRUE when the printer's top cover is open, FALSE
    // otherwise.
    boolean top_cover_open;

    // This flag is TRUE when the printer duplexer is installed, FALSE
    // otherwise.
    boolean duplexer_installed;
} PR_STATUS;


typedef struct{
    UINT32 totalPages;
    boolean printerType;// TRUE for tandam, FALSE for 4 cycle printing, now only support tandam
    boolean color; // TRUE for color image, FALSE for B/W image
    boolean mixInput; // FALSE for single color input, TRUE for B?W and color image input
    UINT32 pagesPerMin;    
} PR_JOB_PARAMETERS_CUSTOM;

#if 0
/** @brief Structure for PRCB_REQUEST_DMBPRINT arguments */
typedef struct {
	/**
	** This field specifies the shingling mode to be used in formatting the
	** image data.  The print formatter supports only a subset of the standard
	** shingling modes, as enumerated above.
	**
	** The shinglingMode selected must be appropriate for the channels included
	** in the DMBImage.  The following matrix indicates which DMBImage types are
	** supported by the different shingling modes.
	**
	** Used for ink-based systems only.
	*/
	UINT8 /* PRCB_SHINGLINGMODE */ shinglingMode;

	/**
	** At the time that the print formatter receives the GO request, the  DMBimages
	** (specified by the image[] array) to be printed may not have been created yet.
	** In this case, the associated image[] entry(s) will be initially set to NULL.
	**/
    void * /* pDMBIMAGE */ image;

	/**
	** At the time that the print formatter receives the GO request, the  DMBimages
	** (specified by the summary[] array) include image summaries to help speed up
	** processing of input images.
	**/
    void * /* pDMBIMAGE */ summaryMap;

    /* flag requesting printer to force the RGB data into conversion to monochrome image */
    boolean forceMono;

} PR_PAGE_PARAMETERS_CUSTOM;
#else
typedef struct
{
    UINT32 dummy;
} PR_PAGE_PARAMETERS_CUSTOM;
#endif


typedef struct
{
    UINT32 dummy;
} PR_SETUP_PARAMS_CUSTOM;

#if 0
typedef struct {
    /**
    ** Summary status for error of the printer.
    **
    ** Unrecoverable print engine errors such as carrier stall, paper system 
    ** errors, and print head shorts will be signalled via this variable.  
    **
    ** Written by the PRU.
    */   
    PR_CUST_STATUS_CURRENT_ERROR CurrentError;

  /** total error counters based on above error message
   */
  UINT32    totalErrorCount; 
    /**
    ** Summary status for warning of the printer.
    **
    ** This variable reports back system warnings that should not cause the 
    ** current job to be interrupted.
    **
    ** Written by the PRU.
    */   
    UINT32 CurrentWarning;

    /** Print head details updated by PE process. */    
    HEAD_DETAILS_t head;

	/**
    ** The count which keeps track of page within job.  This is incremented
    ** by the PR for each page as it is started.  The lower level firmware 
    ** modules (PF, SG, PE) will then begin the consumption of the DMBIMAGE.
    */
	UINT32 pageWithinJob;

    /**
    ** The paperLoaded variable indicates whether or not paper has been success-
    ** fully loaded into the top-of-page position (ie paper is loaded and ready 
    ** to print).  Paper load and eject operations can be performed by commands 
    ** received in the command buffer during print operations or via the 
    ** formfeedRequest/formfeedResponse interface.
    **
    ** Paper load can also occur as result of manual feed event (user pushing in
    ** paper such that it triggers the paper sensor).  Manual feeds will only
    ** be detected and performed by the print engine when it is in an idle state
    ** or when printing and out of paper.  Note that manual feed events can 
    ** occur "behind the back" of the print engine client.  The print engine
    ** client must monitor the paperLoaded variable to determine if manual feeds
    ** have resulted in the paper being loaded.
    */    
    boolean paperLoaded;

    /**
    ** Usage Statistics - Drops fired since the start of a job.
    */
    DOTCOUNT dotcount;

    /**
    ** Media type detect
    **
    ** Media type detection is performed in response to a command request of
    ** type PRCB_REQUEST_MEDIA.  The detected media type will be placed in the 
    ** variable mediaDetect.
    **
    ** It is expected that media type detection will be performed under the 
    ** following conditions:
    ** <ol>
    ** <li> If the user presses the form feed button when the print engine is 
    **     idle and paper is not currently loaded, the high level control module
    **     should first perform a PRCB_REQUEST_MEDIA and then load paper via the
    **     formfeedRequest/formfeedResponse interface.  This will detect the 
    **     media type and then load the paper.  (Once paper has been loaded, it 
    **     is not possible to detect the media type.)
    **
    ** <li> In response to a Host query of the media type, the high level control 
    **     will perform a PRCB_REQUEST_MEDIA if the print engine is
    **     currently idle and paper is not currently loaded.
    **
    ** <li> At the beginning of a local print operation, the high level control 
    **     should perform a PRCB_REQUEST_MEDIA if a sheet of paper is not already
    **     loaded.
    ** </ol>
    ** It is NOT expected that the PE will perform autonomous, periodic media
    ** type detection operations.
    **
    ** The media type detect logic must be calibrated in order to perform 
    ** properly.  Calibration is performed with no paper in the printer such that
    ** the media sensor is imaging the white sticker on the paper feed tray.  The
    ** PRCB_REQUEST_MEDIA request is used to perform a calibration of the 
    ** media detect sensor. 
    **
    ** The media detection string is returned with the following format:
    **
    ** custom-type-media-Q-W-E-R-T
    **
    ** Q - Vendor
    ** W - Finish
    ** E - Bar Code
    ** R - Opacity
    ** T - Misc.
    **
    ** Each category is required and a '0' indicates the category is not valid.
    */
    char mediaType[64];

    char forcedMediaType[64];
    CUST_MEDIA_TYPE_STATES mediaTypeForced;

    /**
    ** Media size detect
    **
    ** Media size detection is performed in response to a command request of
    ** type PRCB_REQUEST_MEDIA.  The detected media size will be placed in the 
    ** variable mediaSize.
    **
    ** It is expected that media size will be performed under the 
    ** following conditions:
    ** <ol>
    ** <li> If the user presses the form feed button when the print engine is 
    **     idle and paper is not currently loaded, the high level control module
    **     should first perform a PRCB_REQUEST_MEDIA and then load paper via the
    **     formfeedRequest/formfeedResponse interface.  This will detect the 
    **     media size and then load the paper.  (Once paper has been loaded, it 
    **     is not possible to detect the media size.)
    **
    ** <li> In response to a Host query of the media size, the high level control 
    **     will perform a PRCB_REQUEST_MEDIA if the print engine is currently 
    **     idle and paper is not currently loaded.
    **
    ** <li> At the beginning of a local print operation, the high level control 
    **     should perform a PRCB_REQUEST_MEDIA if a sheet of paper is not already
    **     loaded.
    ** </ol>
    ** It is NOT expected that the PE will perform autonomous, periodic media
    ** size detection operations.
    */
    PR_MEDIA_SIZE mediaSize;

    /**
    ** Media width detect.  As part of media size detection, this is the actual
    ** width in millimeters of the paper detected.    
    */
    UINT32 mediaWidth;

    /**
    ** This flag will be set to TRUE if the Photo Input Tray is engaged.
    ** The printer automatically sets and clears this flag as the tray is 
    ** engaged and disengaged.
    */
    boolean photoTrayEngaged;

    /**
    ** This flag will be set to TRUE if the Duplexer hardware is installed.
    ** The printer automatically sets and clears this flag.
    */
    boolean duplexerInstalled;

    /** Ink Version. */
    INK_VERSION_t inkVersion;

    /** 
    ** This flag will be set to TRUE if the Top Cover is open.
    ** The printer automatically sets and clears this flag.
    */
    boolean topCoverOpen;

    /** 
    ** This flag will be set to TRUE if the Cleanout hardware is installed.
    ** The printer automatically sets and clears this flag.
    */
    boolean cleanOutInstalled;

	/**
	** To be removed. There are currently dependencies in the PE that must be removed first!
	*/
	PRCB_STATUS_CUST summary;

	/**
	** Set the media amount levels in these variables, so the UI and the PC can display them to the user
	*/
	UINT32 topTrayMediaAmount;
	UINT32 bottomTrayMediaAmount;

	/**
	** This reads the width adjuster in the top tray to identify if 4x6 or 5x7
	*/
	PRCB_MEDIA_WIDTH_t topTrayMediaWidth;

	char topTrayMediaType[64];
	char bottomTrayMediaType[64];

} PR_STATUS_CUSTOM;

#else
#define PR_STATUS_CUSTOM PR_CUST_STATUS

#endif

/******************************************************************************
*  5. GLOBALS
******************************************************************************/

/******************************************************************************
*  6. PUBLIC FUNCTION PROTOTYPES
******************************************************************************/

#ifdef __cplusplus
extern "C" {
#endif

#endif /*  __DC_PRINTER_CUSTOM_API_H__ */
